package com.sprouting.ops.model;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.sprouting.ops.annotations.invoke.CheckIsNullOrEmpty;
import com.sprouting.ops.annotations.invoke.CheckLength;
import com.sprouting.ops.annotations.invoke.CheckNotNull;
import com.sprouting.ops.interfaces.AddGroup;
import com.sprouting.ops.interfaces.UpdGroup;
import lombok.Data;

import javax.validation.constraints.NotNull;

/**
 * 计算机关键文件与文件夹
 *
 * @author ：LX（长沙麓谷）
 * @date 创建时间： 2025/4/23 21:21
 */
@TableName("ops_computer_file")
@Data
public class OpsComputerFile extends BaseModel {

    /**
     * 主键
     */
    @CheckNotNull(message = "非法ID", groups = UpdGroup.class)
    @CheckIsNullOrEmpty(message = "无效ID", groups = AddGroup.class)
    @TableId
    private String id;
    /**
     * 隶属场所-冗余
     * @see OpsSite#getId()
     */
    private String siteId;
    /**
     * 隶属于计算机Id
     * @see OpsComputerServer#getId()
     */
    @CheckNotNull(message = "请选择计算机")
    private String computerServerId;
    /**
     * 名称
     */
    @CheckLength(min = 1, max = 255, message = "名称超过长度限制")
    @CheckNotNull(message = "请输入名称")
    private String name;
    /**
     * 文件还是目录
     * @see com.sprouting.ops.interfaces.ConstantBase.FileOrDir
     */
    @NotNull(message = "请选择是文件还是目录")
    private Integer fileOrDir;
    /**
     * 路径
     */
    @CheckLength(min = 1, max = 2000, message = "路径超过长度限制")
    @CheckNotNull(message = "请输入路径")
    private String path;
    /**
     * 重要性
     * @see com.sprouting.ops.interfaces.ConstantBase.ComputerFileCore
     */
    private Integer core;
    /**
     * 详情说明
     */
    @CheckLength(max = 2000, message = "详情说明超过长度限制")
    private String description;

}
